import {Injectable} from '@angular/core';
import {ReuseTabService} from '@delon/abc/reuse-tab';
import {Router} from '@angular/router';

@Injectable({
  providedIn: 'root'
})
export class CommonsService {

  constructor(private reuseTabService: ReuseTabService,
              private router: Router) {
  }


  // 路由复用replace跳转
  routerReplace(newUrl) {
    this.reuseTabService.replace(newUrl);
    setTimeout(() => {
      this.router.navigateByUrl(newUrl);
    }, 100);
  }

}
